/**
 * Created with Vim7.3 ubuntu12.04
 * @fileOverview : 
 * @author : Lyle
 * @since : 2015-04-29 22:36:07
 * @filename : src/public/components/moduleTA/moduleTA.js
 * @version : 
 * @description : 
 */

define(function() {
    
    var moduleTA = function() {
        
        this.action = function(currentM,nextM) {
            if (currentM) {this.doTA(currentM,'current')};
            if (nextM) {this.doTA(nextM,'next')};
        };

        this.doTA = function(moduleInfo,type) {
            switch(moduleInfo.moduleTA) {
               case 'defaults':
                   this.defaults(moduleInfo,type);
               break;
               default:
                   this.defaults(moduleInfo,type);
            }
        };

        this.defaults = function(moduleInfo,type) {
            $('.module').css('display','none');
            if (type =='current') {
                $('#'+moduleInfo.moduleName).css('display','none');
            } else if (type == 'next') {
                $('#'+moduleInfo.moduleName).css('display','block');
            }
        }; 

        /**
           {
              type: 动画类型
              direction: 动画方向
              offset: 动画偏移量
              speed: 动画时间
              easing: 动画缓冲线
              display: true/false
              fn: callback
           }
        */
        //滑动需要考虑平板菜单show的情况
        this.slider = function(currentM,nextM) {
            var opt = {
                type : 'slide',
                direction: 'left',
                offset: $(window).width(),
                speed: 300,
                easing: 'linear',
                display: true,
            };
            //todo.....
        }; 
    };

    return  new moduleTA;

});
